package com.ptswitch.material.model.common;

import javax.validation.constraints.Size;

import org.hxzon.project.BaseEntity;

public class LoginInfo extends BaseEntity {

    private static final long serialVersionUID = 9167044174602231767L;

    private Uzer user;

    @Size(max = DefineSize32)
    private String username = Uzer.Username_Guess;

    private String token;

    public Uzer getUser() {
        return user;
    }

    public void setUser(Uzer user) {
        this.user = user;
        if (user != null) {
            this.username = user.getUsername();
        } else {
            this.username = null;
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

}
